<div>
	<h3>您确定通过{$data['name']}的产品审核？</h3>
	<div class="button_panel">
		<button id="enter" class="btn btn-info">确认</button>
		&nbsp;&nbsp;
		<button id="close" class="btn btn-info">取消</button>
	</div>
</div>
<style type="text/css">
	h3 {
		margin: 20px 0px;
		text-align: center;
		line-height: 30px;
	}

	.button_panel {
		text-align: center;
	}
</style>
<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
	let id = '{$data['id']}';
	$('#enter').click(function(){
		$.ajax({
			url: 'merchant/product/approve',
			type: 'POST',
			data: {
				id: id
			},
			success: function(re){
				if(re.code) {
					window.parent.layer.msg(re.msg, {
					 	icon: 1, // 错误消息图标，5表示错误
					 	time: 2000, // 2秒后自动关闭
					});
					window.parent.$('.btn-refresh').click();
					Fast.api.close();
				} else {
					window.parent.layer.msg(re.msg, {
						icon: 5, // 错误消息图标，5表示错误
					 	time: 2000, // 2秒后自动关闭
					 	shift: 6, // 显示动画效果
						shade: [0.1, '#fff']
					});
				}
			}
		})
	});
	$('#close').click(function(){
		Fast.api.close();
	});
</script>